Expand description
RustCrypto: PKCS#1 (RSA)
Pure Rust implementation of Public-Key Cryptography Standards (PKCS) #1: RSA Cryptography Specifications Version 2.2 (RFC 8017).
About
This crate supports encoding and decoding RSA private and public keys in either PKCS#1 DER (binary) or PEM (text) formats.
PEM encoded RSA private keys begin with:
-----BEGIN RSA PRIVATE KEY-----
PEM encoded RSA public keys begin with:
-----BEGIN RSA PUBLIC KEY-----
Minimum Supported Rust Version
This crate requires Rust 1.65 at a minimum.
We may change the MSRV in the future, but it will be accompanied by a minor version bump.
License
Licensed under either of:
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
Re-exports
pub use der;
pub use der::pem;
Structs
- Object identifier (OID).
- OtherPrimeInfo
alloc
PKCS#1 OtherPrimeInfo as defined in RFC 8017 Appendix 1.2. - PKCS#1 RSAES-OAEP parameters as defined in RFC 8017 Appendix 2.1
- PKCS#1 RSA Private Keys as defined in RFC 8017 Appendix 1.2.
- PKCS#1 RSASSA-PSS parameters as defined in RFC 8017 Appendix 2.3
- PKCS#1 RSA Public Keys as defined in RFC 8017 Appendix 1.1.
- Unsigned arbitrary precision ASN.1
INTEGER
reference type.
Enums
- Error type
- LineEnding
pem
Line endings: variants of newline characters that can be used with Base64. TrailerField
as defined in RFC 8017 Appendix 2.3.- Version identifier for PKCS#1 documents as defined in RFC 8017 Appendix 1.2.
Constants
- ALGORITHM_ID
pkcs8
AlgorithmIdentifier
for RSA. - ALGORITHM_OID
pkcs8
rsaEncryption
Object Identifier (OID)
Traits
- Parse an
RsaPrivateKey
from a PKCS#1-encoded document. - Parse a
RsaPublicKey
from a PKCS#1-encoded document. - EncodeRsaPrivateKey
alloc
Serialize aRsaPrivateKey
to a PKCS#1 encoded document. - EncodeRsaPublicKey
alloc
Serialize aRsaPublicKey
to a PKCS#1-encoded document.
Type Definitions
- OtherPrimeInfos
alloc
Additional RSA prime info in a multi-prime RSA key. - Result type